import {request} from 'umi';
/** 获取商品信息 GET /api/admin/goods/goods */
export async function getGoodsSearch(params?: Admin.GoodsQueryParams, options?: { [key: string]: any }) {
  return request<Admin.PageQueryVO<Admin.GoodsResult>>('/api/admin/goods/goods', {
    method: 'GET',
    params:params,
    ...(options || {}),
  });
}
/** 保存商品信息 POST /api/admin/goods/save */
export async function saveGoods(params:Admin.GoodsResult, options?: { [key: string]: any }){
  return request<boolean>('/api/admin/goods/save',{
    method: 'POST',
      headers: {
      'Content-Type': 'application/json',
    },
    data:params,
    ...(options || {}),
  })
}
/** 修改商品信息 POST /api/admin/goods/update */
export async function updateGoods(params:Admin.GoodsParam, options?: { [key: string]: any }){
  return request<boolean>('/api/admin/goods/update',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data:params,
    ...(options||{}),
  })
}
/** 删除商品信息 GET /api/admin/goods/delGoods/ */
export async function deleteGoods(id:number,options?: { [key: string]: any }) {
  return request<boolean>('/api/admin/goods/delGoods/'+id,{
    method: 'GET',
    ...(options||{}),
  })
}
